package org.nanotek.cms.domain.message;

import java.util.Map;

import org.nanotek.AbstractBase;
import org.nanotek.Base;
import org.nanotek.Header;
import org.nanotek.Kong;

/**
 * A MessageHeader object which samples a composite object that 
 * holds several other "not known type" of Headers objects (generally a tuple of key-value objects). 
 * It's main characteristic is that the "ID" which identifies the object can 
 * be retrieved by the "Kong get()" method. 
 * @see org.nanotek.Kong
 * 
 * @author josecanovamauger
 *
 * @param <T> Constrains the Object which the Composite object holds, in this case all of same supertype, 
 * Kong<Base<?>>
 * 
 */

@SuppressWarnings("serial")
public class MessageHeader<T extends Kong<Base<?>>> extends AbstractBase<Base<?>> implements Header<T> {

	private Map<Base<?> , T> headers; 
	
	@Override
	public Base<?> get() {
		return getId();
	}

	@Override
	public T getHeader(Base<?> p) {
		return headers.get(p);
	}

}
